package com.a14810100103szm.a7zuxiangmu.model;

import com.a14810100103szm.a7zuxiangmu.Activity.LoginActivity;
import com.a14810100103szm.a7zuxiangmu.Activity.RegisterActivity;
import com.a14810100103szm.a7zuxiangmu.beans.LoginBean;
import com.a14810100103szm.a7zuxiangmu.beans.Result;
import com.a14810100103szm.a7zuxiangmu.services.UserService;


import retrofit2.Call;

/**
 * Created by Administrator on 2017/10/21.
 */

public class UserModel extends RetrofitBaseModel {
    private UserService userService;
    public UserModel() {
        this.userService = retrofit.create(UserService.class);
    }
    public void userLogin(String username, String password, final LoginActivity listener) {
        Call<LoginBean> call = userService.userLogin(username, password);
        bindCallback(call,listener);
    }
    public void register(String username, String userpass, String mobilenum,
                         String address, String comment, final RegisterActivity listener) {
        Call<Result> call = userService.register(username, userpass, mobilenum, address, comment);
        bindCallback(call,listener);
    }
}